package com.itheima.jdk;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;

public class Test1 {
    public static void main(String[] args) throws Exception {
        FileInputStream fileInputStream = new FileInputStream("C:\\Users\\Administrator\\Desktop\\QQ.java");


        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream));
        String s=null;
        String javaCode="";
        while ((s=bufferedReader.readLine())!=null){

            String s1 = s.replace("#content", "System.out.println(\"------------------华丽的分割线----------------------\");");

            javaCode+=s1+"\n";
        }
        System.out.println(javaCode);

        FileOutputStream fileOutputStream = new FileOutputStream("D:\\teachworkspace\\heima380\\heima380_web_hcj\\dynamic\\src\\main\\java\\com\\itheima\\jdk\\QQ2.java");


        fileOutputStream.write(javaCode.getBytes());

        fileInputStream.close();
        fileOutputStream.close();


    }
}
